function saveVector(fid, x)

d = length(x);

fprintf(fid, ['%d' repmat(' %.30g', 1, d) '\n'], [d x]);
